//
//  TableViewController1.m
//  CostomCell
//
//  Created by student on 16/3/7.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "TableViewController1.h"
#import "TableViewCell1.h"

@interface TableViewController1 ()
@property(nonatomic,strong)NSArray *list;
@end

@implementation TableViewController1

- (void)viewDidLoad {
    [super viewDidLoad];
    self.list=@[@{@"Name":@"MacPro",
        @"Icon":@"macpro.jpg",
        @"Color":@"White"},
      @{@"Name":@"iMac",
        @"Icon":@"imac.jpg",
        @"Color":@"Black"},
      @{@"Name":@"MacBook Air",
        @"Icon":@"macbookair.jpg",
        @"Color":@"Sliver"},
      @{@"Name":@"Mac mini",
        @"Icon":@"macmini.jpg",
        @"Color":@"Sliver"},
      @{@"Name":@"MacBookpro",
        @"Icon":@"macbookpro.jpg",
        @"Color":@"Sliver"}];
    self.tableView.rowHeight=140;
}






- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return self.list.count;
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    TableViewCell1 *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];
    NSDictionary *d=self.list[indexPath.row];
//    UIImageView *iconImageView=[cell.contentView viewWithTag:101];
//    UILabel *nameLable=[cell.contentView viewWithTag:102];
//    UILabel *colorLable=[cell.contentView viewWithTag:103];
    cell.iconImageView.image=[UIImage imageNamed:d[@"Icon"]];
    cell.nameLable.text=d[@"Name"];
    cell.colorLable.text=d[@"Color"];
    
    return cell;
}




@end
